package InheritanceAndPolymorphism.demo07;

public class Test {
    public static void main(String[] args) {
        Cat cat = new Cat("小花猫");
        Dog dog = new Dog("小黄狗");
        Eagle eagle = new Eagle("小雄鹰");

        Hero hero1 = new Hero("超级英雄", cat);
        Hero hero2 = new Hero("勇敢英雄", dog);
        Hero hero3 = new Hero("飞行英雄", eagle);
        Hero hero4 = new Hero("孤独英雄");

        hero1.run();
        System.out.println();
        hero2.run();
        System.out.println();
        hero3.run();
        System.out.println();
        hero4.run();
    }
}
